package cn.justforchris.blog.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;

import java.util.Date;

/**
 * 文章实体类
 */
@Data
@Document(collection = "t_article")
public class Article {
    @Id
    private String _id;
    @Field(name = "articleId")
    private Long id;
    private String articlePic;
    @Field(name = "name",targetType = FieldType.STRING)
    private String articleName;
    private String articleTag;
    private Long articleType;
    private Integer articleState;
    private Integer topState;
    private Long publishId;
    @JsonFormat(pattern = "yy-MM-dd",timezone = "GMT+8")
    private Date createTime=new Date();
    @JsonFormat(pattern = "yy-MM-dd",timezone = "GMT+8")
    private Date updateTime;
    private Integer articleReadCount=0;
    private Integer articleStarNum=0;
    private Integer articleCommentNum=0;
    private String articleRemark;
    private String articleContent;
    private String typeName;
    private String publishName;

}
